home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / plaf / basic / BasicTreeUI$TreeEditAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.1 KB  |  30 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import javax.swing.AbstractAction;
  5. import javax.swing.tree.TreePath;
  6.  
  7. class BasicTreeUI$TreeEditAction extends AbstractAction {
  8.    // $FF: synthetic field
  9.    private final BasicTreeUI this$0;
  10.  
  11.    public BasicTreeUI$TreeEditAction(BasicTreeUI var1, String var2) {
  12.       this.this$0 = var1;
  13.    }
  14.  
  15.    public void actionPerformed(ActionEvent var1) {
  16.       if (this.this$0.tree != null && this.this$0.tree.isEnabled()) {
  17.          TreePath var2 = BasicTreeUI.access$4(this.this$0);
  18.          int var3 = var2 != null ? this.this$0.getRowForPath(this.this$0.tree, var2) : -1;
  19.          if (var3 != -1) {
  20.             this.this$0.tree.startEditingAtPath(var2);
  21.          }
  22.       }
  23.  
  24.    }
  25.  
  26.    public boolean isEnabled() {
  27.       return this.this$0.tree != null && this.this$0.tree.isEnabled();
  28.    }
  29. }
  30.